﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FunctionEdit.aspx.cs" Inherits="Sdepci.InfoCode.Web.Authority.FunctionEdit" %>
<%@ Register src="../Includes/VerifyLoginState.ascx" tagname="VerifyLoginState" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>菜单编辑</title>
    <link rel="stylesheet" type="text/css" href="../Css/Style.css" />
    <link rel="stylesheet" type="text/css" href="../Css/Backstage.css" />
    <script type="text/javascript" src="../Javascript/Common.js"></script>
    <script type="text/javascript">
    // 输入域检查
    function ValidateInput()
    {
        document.getElementById("FuncDesc").value = document.getElementById("FuncDesc").value.trim();
        if (document.getElementById("FuncDesc").value == "") {
            alert("菜单名称不能为空！");
            document.getElementById("FuncDesc").focus();
            document.getElementById("FuncDesc").select();
            return false;
        }

        document.getElementById("Seq").value = document.getElementById("Seq").value.trim();
        if (!checkNaturalNumber(document.getElementById("Seq").value)) {
            alert("显示次序必须是正整数！");
            document.getElementById("Seq").focus();
            document.getElementById("Seq").select();
            return false;
        }

        return true;
    }

    // 选择菜单图标
    function SelectMenuIcon()
    {
        var result = window.showModalDialog("MenuIconSelector.aspx?FuncIcon=" + document.getElementById("FuncIcon").value, window, "dialogWidth:350px;dialogHeight:520px");
        if (result != undefined)
        {
            document.getElementById("FuncIcon").value = result;
            document.getElementById("imgFuncIcon").src = "../Images/MenuIcon/" + result;
        }
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <uc1:VerifyLoginState ID="VerifyLoginState1" runat="server" />
    <div id="container">
        <div id="editregion">
            <table style="width: 100%;">
                <caption><asp:Label ID="lblTitle" runat="server" Text="菜单编辑"></asp:Label></caption>
                <tr>
                    <td class="label"><font color="#ff0000"> ※ </font>菜单名称：</td>
                    <td class="input">
                        <asp:TextBox ID="FuncDesc" CssClass="text" MaxLength="20" runat="server"></asp:TextBox>
                    </td>
                    <td class="label"><font color="#ff0000"> ※ </font>显示次序：</td>
                    <td class="input">
                        <asp:TextBox ID="Seq" CssClass="text" MaxLength="4" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="label">Url地址：</td>
                    <td class="input" colspan="3">
                        <asp:TextBox ID="FuncUrl" CssClass="text" MaxLength="100" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="label">菜单图标：</td>
                    <td class="input" colspan="3">
                        <asp:TextBox ID="FuncIcon" CssClass="text" MaxLength="100" Width="200px" runat="server"></asp:TextBox>
                        <asp:Image ID="imgFuncIcon" ImageAlign="Middle" Width="20px" Height="20px" runat="server" />
                        <input type="button" class="button-open" onclick="javascript:SelectMenuIcon();" />
                    </td>
                </tr>
            </table>
        </div>
        <div id="buttonregion">
            <asp:Button ID="btnSave" CssClass="button" runat="server" Text="保存" UseSubmitBehavior="false" onclick="btnSave_Click" OnClientClick="javascript:if(!ValidateInput()) return false;" />
            <asp:Button ID="btnCancel" CssClass="button" runat="server" Text="取消" UseSubmitBehavior="false" onclick="btnCancel_Click" />
        </div>
        <div id="tipsregion">
            标有“<font color="#ff0000"> ※ </font>”符号的为必填项。<br />
            如果Url地址留空，则表示该菜单项只作为目录分类，不作为功能节点。<br />
        </div>
    </div>
    </form>
</body>
</html>
